﻿/*
 * Created by SharpDevelop.
 * User: Usuario
 * Date: 27/11/2011
 * Time: 12:37 a.m.
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
using PetSoft.GestionRecursos;
using PetSoft.GUI.GestRecursos;
using PetSoft.GUI.Compras;
using PetSoft.GUI.Ventas;
using PetSoft.GUI.Clinica;
using PetSoft.GUI.RRHH;
using Business_Logic;

namespace PetSoft.GUI
{
	/// <summary>
	/// Description of GUIPetsoftInicial.
	/// </summary>
	public partial class GUIPetsoftInicial : Form
	{
		public GUIPetsoftInicial()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
			
			
			
			BLPrivilegio blpriv = new BLPrivilegio();
            
            //this.administraciónToolStripMenuItem.Enabled = false;
            
            if (!blpriv.existeModulo("VENT",BLInfo.usuarioActual.Rol.Privilegio)){
            	this.ventasBTN.Enabled = false;
            } 
            
            if (!blpriv.existeModulo("COMP",BLInfo.usuarioActual.Rol.Privilegio)){
            	this.comprasBTN.Enabled = false;
            } 
            
            if (!blpriv.existeModulo("SERV",BLInfo.usuarioActual.Rol.Privilegio)){
            	this.atServBTN.Enabled = false;
            } 
            
            if (!blpriv.existeModulo("GREC",BLInfo.usuarioActual.Rol.Privilegio)){
            	this.gesRecBTN.Enabled = false;
            }
		
            if (!blpriv.existeModulo("RRHH",BLInfo.usuarioActual.Rol.Privilegio)){
            	this.recHumBTN.Enabled = false;
            }            
            if (!blpriv.existeModulo("CONF",BLInfo.usuarioActual.Rol.Privilegio)){
            	this.confBTN.Enabled = false;
            }
            
            if (!blpriv.existeModulo("SEGU",BLInfo.usuarioActual.Rol.Privilegio)){
            	this.segBTN.Enabled = false;
            }  
            
            
			
			//
			// TODO: Add constructor code after the InitializeComponent() call.
			//
		}
		
		void Button1Click(object sender, EventArgs e)
		{
			GUIMenuVentas vVenta = new GUIMenuVentas();
			vVenta.ShowDialog();
		}
		
		void Button4Click(object sender, EventArgs e)
		{
			GUIMenuGGRR vent = new GUIMenuGGRR();
			//this.Hide();
			vent.ShowDialog();
			//this.Show();
		}
		
		void Button8Click(object sender, EventArgs e)
		{
			this.Close();
		}
		
		void ComprasBTNClick(object sender, EventArgs e)
		{
			GUIMenuCompras vComp = new GUIMenuCompras();
			vComp.ShowDialog();
		}
		
		void AtServBTNClick(object sender, EventArgs e)
		{
			GUIMenuClinica vCli = new GUIMenuClinica();
			vCli.ShowDialog();
		}
		
		void PictureBox1MouseEnter(object sender, EventArgs e)
		{
			this.pictureBox1.Image = megustaPB.Image;
		}
		
		void GUIPetsoftInicialLoad(object sender, EventArgs e)
		{
			this.pictureBox1.Image = normalPB.Image;
		}
		
		void PictureBox1MouseLeave(object sender, EventArgs e)
		{
			this.pictureBox1.Image = normalPB.Image;
		}
		
		void RecHumBTNClick(object sender, EventArgs e)
		{
			GUIMenuRRHH vRRHH = new GUIMenuRRHH();
			vRRHH.ShowDialog();
		}
		
		void SegBTNClick(object sender, EventArgs e)
		{
			Seguridad.GUIMenuSeg menu = new Seguridad.GUIMenuSeg();
			menu.ShowDialog(this);
		}
		
		void ConfBTNClick(object sender, EventArgs e)
		{
			Configuracion.GUIMenuConfiguracion menu=new PetSoft.GUI.Configuracion.GUIMenuConfiguracion();
			menu.ShowDialog(this);
		}
	}
}
